CXX = gcc
TARGET = sc-pivot
C_FLAGS += -fPIC -g -O
LIB_FLAGS = -lpthread -ldl -lev
INC =
LIB =

sources = \
	main.c mem_pool.c acceptor.c client_manager.c

obj_list = $(sources:.c=.o)

.PHONY: all clean run
 
all: $(TARGET)

sc-pivot: $(obj_list)
	$(CXX) -o $@ $^ $(C_FLAGS) $(LIB_FLAGS) $(INC) $(LIB)

.cpp.o:
	$(CXX) -c -o $*.o $(INC) $(C_FLAGS) $*.cpp
.c.o:
	$(CXX) -c -o $*.o $(INC) $(C_FLAGS) $*.c
clean:
	-rm -f *.o $(TARGET)